$(function(){
	$('#btn-search').click(function() {
		if($.trim($('#keyword').val()) != '') {
			$('#frm-search').submit();
		}
	});

	$('#captcha').after('<img src="/index/captcha?n='+ Math.random() +'" class="image-captcha"><a class="change-captcha" href="#a"><i class="icon-refresh"></i></a>');
	$('.change-captcha').live('click', function() {
	    $('.image-captcha').attr('src', '/index/captcha?n=' + Math.random());
	});
	
	//open social : FACEBOOK
	(function(d, s, id) {
		  var js, fjs = d.getElementsByTagName(s)[0];
		  if (d.getElementById(id)) return;
		  js = d.createElement(s); js.id = id;
		  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=127373934063699";
		  fjs.parentNode.insertBefore(js, fjs); 
		}(document, 'script', 'facebook-jssdk'));
});

